home *** CD-ROM | disk | FTP | other *** search
/ Sounds Terrific 1 / Sounds Terrific CD (1994)(Weird Science)(Disc 2 of 2)[!][Amiga-PC].iso / modules / f / filept.mod < prev    next >
Encoding:
Text File  |  1994-08-04  |  5.5 KB  |  154 lines

  1. File Point Mod
  2. Ice Man #1 @8406
  3. Saturday, December 14, 1991   6:07 pm
  4.  
  5.                              File Point Mod
  6.                           By Ice Man #1 @8406
  7.  
  8. Description:    Allows sysops to use a file point system instead of the normal
  9.                 ratio system.  For every file point a user has, they can
  10.                 download 1 K.  When a user sends in money, add the appropriate
  11.                 number of file points to his/her account.  This mod also keeps
  12.                 track of how much a user has contributed, although its not
  13.                 related to how many file points they have.
  14. WWIV version:   4.11, but could be easily adapted to 4.12 or 4.20 as far as I
  15.                 can tell.
  16. Files affected: XFER.C, VARDEC.H, SYSOPF.C
  17.  
  18. Step 1.  First off, since this mod changes your user structure, you'll have to
  19.          do one of two things: a) trash your user list, or b) get a CONVERT.C
  20.          for WWIV 4.11, and modify it do it'll convert your old user list into
  21.          a new one with this mod in.  If you know C pretty good, try B.  If you
  22.          don't, either try A or don't put this mod in.
  23.  
  24. Step 2.  BACKUP YOUR SOURCE CODE!!!
  25.  
  26. Step 3.  Load up VARDEC.H and make the following changes:
  27.  
  28. /*==*/                  ontoday;                /* num times on today */
  29. /*==*/  unsigned short  homeuser,homesys,       /* where user can be found */
  30. /*++*/                  contrib,                /* $ contributed by user */
  31. /*==*/                  forwardusr,forwardsys,  /* where to forward mail */
  32. /*==*/                  msgpost,                /* number messages posted */
  33. /*==*/  unsigned long   msgread,                /* total num msgs read */
  34. /*++*/                  dlpoints,               /* user's DL points */
  35. /*==*/                  uk,                     /* number of k uploaded */
  36. /*==*/                  dk,                     /* number of k downloaded */
  37.  
  38. Step 4.  Load up SYSOPF.C and seach(^Q,F) down for void uedit(blahblah).  Make
  39.          the following changes:
  40.  
  41. /*==*/prt(2,"Uedit : ");
  42. /*==*/if ((realsl==255) || (wfc))
  43. /*+-*/  ch=onek("#$Q[]{}/,.?UDRNLCPOGMSTEYZAI~:");  /* # and $ added */
  44. /*==*/else                                          /* # for file points */
  45. /*+-*/  ch=onek("#$Q[]{}/,.?UDRNLCPOGMSTEYZAI");    /* $ for contributed */
  46. /*==*/switch(ch) {
  47. /*add*/ case '#':
  48. /*from*/  prt(2,"New file points? ");
  49. /*here*/  input(s2,5);
  50.           if (s2[0])
  51.           i=atoi(s2);
  52.             u.dlpoints=i;
  53.             ite_user(un,&u);
  54.           }
  55.           break;
  56.         case '$':
  57.           prt(2,"New money contributed? (without dollar sign) ");
  58.           input(s2,5);
  59.           if (s2[0]) {
  60.             i=atoi(s2);
  61.             u.contrib=i;
  62.             write_user(un,&u);
  63.           }
  64. /* here */break;
  65. /*==*/  case 'Q':
  66. /*==*/    done=1;
  67.  
  68. Step 5.  Load up XFER.C and search down for void download_temp_arc().  Search
  69.          down and make the following changes:
  70.  
  71. /*==*/  numbytes=filelength(f);
  72. /*==*/  close(f);
  73. /*++*/  if ((numbytes+1023)/1024>thisuser.dlpoints) {
  74. /*++*/    nl();
  75. /*++*/    prt(5,"I'm sorry, you don't have enough file points to DL that file.");
  76. /*++*/    nl();
  77. /*++*/    return;
  78. /*++*/  }
  79. /*==*/  if (numbytes==0L) {
  80. /*==*/    nl();
  81.  
  82. Step 6.  Still in void download_temp_arc(), search down a little further and
  83.          make the following changes:
  84.  
  85. /*==*/      sprintf(s1,"%-6.3f",ratio());
  86. /*==*/      print("Your ratio is now: ",s1,"");
  87. /*++*/      thisuser.dlpoints=thisuser.dlpoints-(((numbytes)+1023)/1024);
  88. /*++*/      ltoa(thisuser.dlpoints,s,10);
  89. /*++*/      prt(0,"You now have ");
  90. /*++*/      prt(0,s);
  91. /*++*/      pl(" file points left.");
  92. /*==*/
  93. /*==*/      if (useron)
  94. /*==*/        topscreen();
  95.  
  96. Step 7.  Still in XFER.C, search down (^Q,F) for int try_to_download() and make
  97.          the following changes:
  98.  
  99. /*==*/    SETREC(i);
  100. /*==*/    read(dlf,(void *)&u,sizeof(uploadsrec));
  101. /*++*/    if ((u.numbytes+1023)/1024>thisuser.dlpoints) {
  102. /*++*/      nl();
  103. /*++*/      prt(5,"I'm sorry, you don't have enough file points to DL that file.");
  104. /*++*/      nl();
  105. /*++*/      closedl();
  106. /*++*/      return(-1);
  107. /*++*/    }
  108. /*==*/    nl();
  109. /*==*/    if (title)
  110. /*==*/      print("Directory  : ",directories[dn].name,"");
  111.  
  112. Step 8.  A little bit further down, make the following changes:
  113.  
  114. /*==*/  sprintf(s1,"%-6.3f",ratio());
  115. /*==*/  print("Your ratio is now: ",s1,"");
  116. /*++*/  thisuser.dlpoints=thisuser.dlpoints-(((u.numbytes)+1023)/1024);
  117. /*++*/  ltoa(thisuser.dlpoints,s,10);
  118. /*++*/  prt(0,"You now have ");
  119. /*++*/  prt(0,s);
  120. /*++*/  pl(" file points left.");
  121. /*==*/
  122. /*==*/  if (useron)
  123. /*==*/    topscreen();
  124.  
  125. Step 9.  Still in XFER.C, search down for void yourinfodl() and replace the
  126.          entire function with this one.
  127.  
  128. void yourinfodl()
  129. {
  130.   char s[81],s1[81],s2[81],s3[81],s4[81];
  131.  
  132.   itoa(thisuser.uploaded,s,10);
  133.   itoa(thisuser.downloaded,s1,10);
  134.   ltoa(thisuser.uk,s2,10);
  135.   ltoa(thisuser.dk,s3,10);
  136.   ltoa(thisuser.dlpoints,s4,10);
  137.   nl();
  138.   nl();
  139.   print("Uploads  : ",s2,"k in ",s," files","");
  140.   print("Downloads: ",s3,"k in ",s1," files","");
  141.   print("File Points (K you can DL): ",s4,"");   /*  add */
  142.   sprintf(s,"%-6.3f",ratio());
  143.   print("Ratio    : ",s,"");
  144.   itoa(thisuser.dsl,s,10);
  145.   print("Your DSL : ",s,"");
  146.   nl();
  147. }
  148.  
  149. Step 10.  Recompile it!
  150.  
  151.     If you have any questions, complaints, comments, etc., sent them to #1
  152. @8406(WWIVnet).  If you use this mod, please leave me some mail telling me you
  153. are.  If you're using 4.20, but would really like to use this mod, e-mail me
  154. and I'll try and write one for it.